//
// Created by chengs1r on 2021/8/13.
// 字符串是以\0为结束标志
//

#include <stdio.h>

int main() {
    // 三个字符串数组
    char arr1[] = "bit";
    char arr2[] = {'b', 'i', 't'};
    char arr3[] = {'b', 'i', 't', '\0'};

    printf("arr1数组情况：\n");
    printf("数组大小: %lu \n", sizeof arr1 / sizeof(char));
    printf("字符串数组打印结果:%s\n", arr1);
    printf("\n");

    // 数组2因为没有字符串结束标志，会循这起始地址一直向下打印，直到遇到'\0'结束标志
    printf("arr2数组情况：\n");
    printf("数组大小: %lu \n", sizeof arr2 / sizeof(char));
    printf("字符串数组打印结果:%s\n", arr2);
    printf("\n");

    printf("arr3数组情况：\n");
    printf("数组大小: %lu \n", sizeof arr3 / sizeof(char));
    printf("字符串数组打印结果:%s\n", arr3);
    printf("\n");
    return 0;
}